package flextestng.testing
{
	import flextestng.testing.model.SuiteDefinition;
	import flextestng.testing.utils.IModuleLoaderListener;
	import flextestng.testing.utils.TestModuleLoader;

	public class SuiteRunner implements ISuiteRunner, IModuleLoaderListener
	{
		private var _suite:SuiteDefinition;
		private var _loader:TestModuleLoader;
		
		public function SuiteRunner(suite:SuiteDefinition)
		{
			_suite = suite;
			_loader = new TestModuleLoader(_suite.moduleFile);
			_loader.addModuleListener(this);
		}
		
		public function error(error:String):void
		{
			trace("module error");
		}
		
		public function ready():void
		{
			trace("module loaded");
		}
		
		public function run():void
		{
			// starts the test sequence by loading the module.
			_loader.load();
		}
	}
}